package com.iscas.green.httpclienttest.controller;

import com.iscas.green.httpclienttest.httpclient.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class HttpClientTestController {

    @Autowired
    private RestTemplateService restTemplateService;

    @GetMapping("/httpclient3")
    public String testHttpClient3() {
        return HttpClient3Example.callService();
    }

    @GetMapping("/httpclient4")
    public String testHttpClient4() {
        return HttpClient4Example.callService();
    }

    @GetMapping("/okhttp3")
    public String testOkHttp3() {
        return OkHttp3Example.callService();
    }

    @GetMapping("/resttemplate")
    public String testRestTemplate() {
        return restTemplateService.callService();
    }

}
